﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.HtmlControls;
using Com.Iooogle.Bms.Controls;
using System.IO;

namespace Com.Iooogle.Bms.Core
{
	/// <summary>
	/// 前端基础类。
	/// </summary>
	public class BasePage : System.Web.UI.Page
	{
		/// <summary>
		/// 获取或设置标准视图名称。
		/// </summary>
		public string Viewer { get; set; }

		/// <summary>
		/// 获取或设置标准行为名称。
		/// </summary>
		public string Action { get; set; }

		/// <summary>
		/// 重写初始化方法。
		/// </summary>
		/// <param name="e"></param>
		protected override void OnPreInit(EventArgs e)
		{
			base.OnPreInit(e);

			ExternalResourceLoader extraResourceLoader = (( ExternalResourceLoader ) Page.FindControl("DefaultExternalResourceLoader"));
			if (extraResourceLoader != null) {
				extraResourceLoader.Scripts.Add("Contents/ClientScripts/jquery.js");
				extraResourceLoader.Scripts.Add("Contents/ClientScripts/core-default.js");
				extraResourceLoader.Stylesheets.Add("Contents/Css/Theme_Default.css");
			}
		}

		/// <summary>
		/// 重写预加载方法。
		/// </summary>
		/// <param name="e"></param>
		protected override void OnPreLoad(EventArgs e)
		{
			base.OnPreLoad(e);

			this.Viewer = UrlKit.GetString("View");
			this.Action = UrlKit.GetString("Action");
		}
	}
}
